package com.zp.self;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

/**
 * Created by zengpeng on 2020/12/07
 */
@SpringBootApplication
public class GradleApplication {
    public static void main(String[] args) {
        SpringApplication.run(GradleApplication.class, args);
    }


    @RestController
    class EchoController {
        @Value("${server.port}")
        String port;

        @GetMapping("/hi")//上传
        public String hi(String name ){
            int random = new Random().nextInt(2);
            System.out.println(1/random );
            return "hi "+name+",  are you a master ? 这里是端口："+port;
        }
    }



}
